package com.code.day13String;

import java.awt.*;
import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String username = "root";
        String password = "root";
        for (int i = 0; i <3 ; i++) {
            System.out.println("请输入用户名");
            String name = sc.next();
            System.out.println("请输入密码");
            String pwd = sc.next();
            if(name.equals(username) && pwd.equals(password)){
                System.out.println("登入成功");
                break;
            }else {
                if(i==2){
                    System.out.println("账号冻结");
                }else {
                    System.out.println("登录失败");
                }

            }
        }
    }
}
